package datastructure.stack;


public class MyStackTest {
    public static void main(String[] args) {
        // MyArrayStack<Integer> myStack = new MyArrayStack<>();
        // for (int i = 1; i < 5; i++) {
        // myStack.push(i);
        // System.out.println(myStack);
        // }
        // // 弹栈操作
        // Integer pop = myStack.pop();
        // System.out.println(myStack + "--" + pop);
        StactDemo demo = new StactDemo();
        System.out.println(demo.isValid("[]{()}"));
        System.out.println(demo.isValid("[]{{()}{"));
        System.out.println(demo.isValid("}{"));
    }

    public void LinkedListStackTest() {
        LinkedListStack<Integer> stack = new LinkedListStack<>();
        for (int i = 1; i < 5; i++) {
            stack.push(i);
            System.out.println(stack);
        }
        // 弹栈操作
        Integer pop = stack.pop();
        System.out.println(stack + "--" + pop);

    }

}
